GtkAppliation: setup icon theme resource path
authorRyan Lortie <desrt@desrt.ca>
Mon, 7 Jul 2014 18:32:10 +0000 (14:32 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 7 Jul 2014 18:46:27 +0000 (14:46 -0400)
If we have a resource base path for the application, set up an icon
theme search path based on it (within the default icon theme).

https://bugzilla.gnome.org/show_bug.cgi?id=722092

gtk/gtkapplication.c

index 27a513a2fa285e1aae7a12679bab1ec2f3d2f0c9..c79f80ea05d734aaae5e71bbc477ae627e6cc7bc 100644 (file)
@@ -36,6 +36,7 @@
 #include "gtkmain.h"
 #include "gtkrecentmanager.h"
 #include "gtkaccelmapprivate.h"
+#include "gtkicontheme.h"
 #include "gtkbuilder.h"
 #include "gtkintl.h"
 
@@ -514,6 +515,17 @@ gtk_application_load_resources (GtkApplication *application)
   if (base_path == NULL)
     return;
 
+  /* Expand the icon search path */
+  {
+    GtkIconTheme *default_theme;
+    gchar *iconspath;
+
+    default_theme = gtk_icon_theme_get_default ();
+    iconspath = g_strconcat (base_path, "/icons", NULL);
+    gtk_icon_theme_add_resource_path (default_theme, iconspath);
+    g_free (iconspath);
+  }
+
   /* Load the menus */
   {
     gchar *menuspath;